<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <!-- 实现响应式，支持移动设备 -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" type="text/css" href="../bootstrap-4.3.1-dist/css/bootstrap.min.css">
    <title>栅格系统-对齐方式</title>
    <script src="../bootstrap-4.3.1-dist/js/jquery-1.7.2.js"></script>
    <script src="../bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
    <script src="../bootstrap-4.3.1-dist/js/popper.js"></script>
    <style>
        /*.container{*/
        /*    height: 100px;*/
        /*    background-color: pink;*/
        /*}*/
        .container>.row{
            height: 200px;
            background-color: pink;
        }
        .container>div>div:nth-child(1){
            background-color: red;
        }

        .container>div>div:nth-child(2){
            background-color: green;
        }

        .container>div>div:nth-child(3){
            background-color: blue;
        }

        .container>div>div:nth-child(4){
            background-color: purple;
        }
    </style>
</head>
<body>
    <div class="container">
        <!--垂直对齐,默认顶部对齐-->
        <div class="row align-items-start">
            <div class="col-sm-3">第一部分</div>
            <div class="col-sm-3">第二部分</div>
        </div>
        <!--垂直对齐,居中对齐-->
        <div class="row align-items-center">
            <div class="col-sm-3">第一部分</div>
            <div class="col-sm-3">第二部分</div>
        </div>
        <!--垂直对齐,底部对齐-->
        <div class="row align-items-end">
            <div class="col-sm-3">第一部分</div>
            <div class="col-sm-3">第二部分</div>
        </div>
    </div>
    <br/><br/><br/>
    <div class="container">
        <!--水平对齐,默认-->
        <div class="row justify-content-start">
            <div class="col-md-3 ">第一部分</div>
            <div class="col-md-3">第二部分</div>
        </div>
        <div class="row justify-content-center">
            <div class="col-md-3 ">第一部分</div>
            <div class="col-md-3">第二部分</div>
        </div>
        <div class="row justify-content-end">
            <div class="col-md-3 ">第一部分</div>
            <div class="col-md-3">第二部分</div>
        </div><br/>
    </div>
</body>
</html>